package com.example.hotel.service.impl;

import com.example.hotel.dao.ItemDao;
import com.example.hotel.dao.ManagerDao;
import com.example.hotel.entity.Item;
import com.example.hotel.entity.Manager;
import com.example.hotel.service.ManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ManagerServiceImpl implements ManagerService {

    @Autowired
    private ManagerDao managerDao;

    @Override
    public List<Manager> findAll() {
        return managerDao.findAll();
    }

    @Override
    @Transactional
    public int add(Manager manager) {
        int r = managerDao.add(manager);
        return r;
    }



@Override
    public int deleteById(int manager_id) {
        return managerDao.deleteById(manager_id);
    }



        @Override
        public int update(Manager manager) {
            return managerDao.update(manager);
        }
    }
